﻿<UserControl x:Class="FrontEnd.SelectFileTextBox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
			 xmlns:my="clr-namespace:FrontEnd">
	<Grid>
		<Grid.Resources>
			<my:FileSelectorStateToErrorVisibility x:Key="FileSelectorStateToErrorVisibility"></my:FileSelectorStateToErrorVisibility>
		</Grid.Resources>
		<Grid.ColumnDefinitions>
			<ColumnDefinition />
			<ColumnDefinition Width="auto" />
			<ColumnDefinition Width="auto" />
		</Grid.ColumnDefinitions>
		<TextBox Name="txtPath" Text="{Binding Path}" IsReadOnly="True" VerticalContentAlignment="Center" MinWidth="100" Grid.ColumnSpan="3" Padding="3,0,22,0" />
		<Image Source="/DBEnv;component/Images/Error.png" Visibility="{Binding State, Converter={StaticResource FileSelectorStateToErrorVisibility}}" Width="20" Grid.Column="1" Stretch="None" ToolTip="The file is invalid." />
		<Button Name="btnOpen" Content="..." Grid.Column="2" Margin="3" Width="20" Click="btnOpen_Click" />
	</Grid>
</UserControl>
